<template>
  <main>
    <div class="menu flex-row-sb-center" style="margin-top: 20px;" @click="mineClick('address')">
      <p><span class="iconfont icon-icon-GIS_dizhi" style="color: #0097FF;"></span>我的地址</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
    <div class="menu flex-row-sb-center" style="margin-top: 20px;" @click="mineClick('shop')">
      <p><span class="iconfont icon-shangcheng1" style="color: #94d94a;"></span>金币商城</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
    <div class="menu flex-row-sb-center" @click="mineClick('share')">
      <p><span class="iconfont icon-weibiaoti1" style="color: #f06236;"></span>分享拿20元现金</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
    <div class="menu flex-row-sb-center" style="margin-top: 20px;" @click="mineClick('kefu')">
      <p><span class="iconfont icon-kefu" style="color: #4da6f0;"></span>我的客服</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
    <div class="menu flex-row-sb-center" @click="downloadApp">
      <p><span class="iconfont icon-app" style="color: #4da6f0;"></span>下载饿了么APP</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
    <div class="menu flex-row-sb-center" @click="mineClick('rules')">
      <p><span class="iconfont icon-guizeshuoming" style="color: #4da6f0;"></span>规则中心</p>
      <span class="iconfont icon-jiantou-elm"></span>
    </div>
  </main>
</template>

<script>
export default {
  name: 'mine-main',
  methods: {
    async mineClick(type) {
      if(!this.$store.state.token && type !== 'shop' && type !== 'rules') {
        return this.$router.push('/login')
      }
      if(type === 'address') {
        this.$router.push('/myaddress')
      }else if(type === 'shop'){
        this.$router.push('/goldcoinshop')
      }else if(type === 'share'){
        this.$router.push('/activitedpage')
      }else if(type === 'kefu'){
        this.$router.push('/kefu')
      }else if(type === 'rules'){
        this.$router.push('/rules')
      }
    },
    downloadApp() {
      window.open('http://h5.ele.me/download/')
    }
  }
}
</script>

<style scoped>
  .menu {
    background-color: #fff;
    font-size: 34px;
  }
  .iconfont {
    font-size: 38px;
    margin: 0 15px;
  }
</style>
